package com.ys.day32.p2注解的深入应用;

import java.util.Date;

/**
 * 描述: 实体类
 *  自定义注解来直接描述类的属性字段信息来设置 json的信息
 *
 * @author CodeYang
 * @version 2021/1/18 17:29
 */

@JSONFiled2(
        filedOldName = {"id","name","age","password","date"}
        ,filedNewName = {"user_id","user_name","user_age","user_password","user_date"},
        patter = "yyyy-MM-dd HH:mm:ss"
)
public class User2 {


    private Integer id;
    private String name;
    private Integer age;
    private String password;
    private Date date;

    public User2() {
    }

    public User2(Integer id, String name, Integer age, String password, Date date) {
        this.id = id;
        this.name = name;
        this.age = age;
        this.password = password;
        this.date = date;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", age=" + age +
                ", password='" + password + '\'' +
                ", date=" + date +
                '}';
    }
}
